package com.kantboot.business.water.web.admin.controller;

import com.kantboot.business.water.domain.entity.BusWaterGoods;
import com.kantboot.business.water.service.IBusWaterGoodsService;
import com.kantboot.system.user.service.IUserSelfService;
import com.kantboot.util.common.result.RestResult;
import com.kantboot.util.core.controller.BaseAdminController;
import com.kantboot.util.core.param.PageParam;
import com.kantboot.util.core.result.PageResult;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商品
 */
@RestController
@RequestMapping("/bus/water/admin/goods")
public class BusWaterGoodsControllerOfAdmin extends BaseAdminController<BusWaterGoods,Long>{

    @Resource
    private IBusWaterGoodsService service;

    @Resource
    private IUserSelfService userSelfService;

    @RequestMapping("/getBodyData")
    public RestResult<PageResult> getBodyData(@RequestBody PageParam<BusWaterGoods> pageParam) {
        return RestResult.success(service.getBodyData(pageParam), "getSuccess","获取成功");
    }

    /**
     * 删除
     */
    @RequestMapping("/removeBatch")
    public RestResult removeBatch(@RequestBody List<BusWaterGoods> param) {
        service.removeBatch(param);
        return RestResult.success(Boolean.TRUE, "optSuccess", "操作成功");
    }

    @RequestMapping("/save")
    public RestResult save(@RequestBody BusWaterGoods goods) {
        service.save(goods);
        return RestResult.success(Boolean.TRUE, "optSuccess", "操作成功");
    }



}

